package com.aaa.mapper;

import com.aaa.entity.Role;
import com.aaa.entity.Users;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<Users> {
     List<Users> listAll(String keyword);
     List<Role> listRole(Long uid);
    //添加
     int add(Users users);
    //修改
     int update(Users users);
    //删除
     int delete(Long uid);
    //删除角色
     int deleteRole(Long uid);
    //添加角色
     int addRole(@Param("uid") Long uid, @Param("rid") Long rid);
    //    getUserRoles
     Integer getUserRolesCountByUid(Long uid);
    //    根据uid和rid delRole
     int delRole(@Param("uid") Long uid, @Param("rid") Long rid);
    //    重置密码
     int resetPassword(@Param("uid") Long uid, @Param("password") String password);

    List<Role> listAllRole();
}

